Page({
    data: {
        temp: "",
        type: "",
        city: "",
        week: "",
        weather: "",
        otherWeather: [
        ]
    },
    onLoad(options) {
        wx.request({
            url: 'http://ajax-api.itheima.net/api/weather?city=台州',
            header: {
                'content-type': 'application/json' // 默认值
            },
            success:(res)=> {
                res=res.data.data
                console.log(res);

                this.setData({
                    city:res.city,
                    type:res.data[0].wea,
                    temp:res.data[0].tem,
                    week:res.data[0].day,
                    weather:res.data[0].narrative,
                    otherWeather:res.data
                })
            }
        })
    },
})